import { BUSINESS_TYPE } from '@/utils/const/process';
import ApproverChange from '@/components/Common/auditProcess/approverChange';
export default {
  components: {
    ApproverChange
  },
  data() {
    return {
      BUSINESS_TYPE,
      curSelectedId: '' // 当前需要变更的id
    };
  },
  methods: {
    // 审批人员批量变更
    handleBatchApproverChange(type = this.BUSINESS_TYPE.CONTRACT) {
      const ids = this.multipleSelectionAll.map(i => i.id).join(',');
      if (!ids) {
        this.$message.warning(this.tips(type));
        return;
      }
      this.curSelectedId = ids;
      this.$refs['approverChangeDialog'].dialogVisible = true;
    },
    tips(type) {
      const tips = {
        0: '请先选择合同',
        1: '请先选择付款审批单',
        7: '请先选择员工报销审批单',
        8: '请先选择借款审批单',
        9: '请先选择还款审批单',
        10: '请先选择审批单',
        11: '请先选择需要转交的欠款单'
      };
      return tips[type] || '请先选择审批单';
    },
    changeCallBack() {
      this.fetchData && this.fetchData();
      this.clearMixinSelection && this.clearMixinSelection();
    }
  }
};
